extends Control
# Called when the node enters the scene tree for the first time.
var 进度条: ProgressBar
var 少女祈祷中: Label
var scene = "res://Files/StageMap/游戏地图.tscn"
func _ready() -> void:
	进度条 = $"滚动条"
	少女祈祷中 = $"少女祈祷中"
	进度条.value =0.0
	set_process(false)
	startLoading(sceneSlect())
	pass # Replace with function body.
func startLoading(scene:String):
	self.scene = scene
	var loader = ResourceLoader.load_threaded_request(scene)
	进度条.value =0
	set_process(true)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _on_scene_loaded(resource):
	if(get_tree().change_scene_to_file(resource)==OK):
		print("成功换场景")
	else:
		print("切你妈")
func _process(delta: float) -> void:
	var a:Array
	if ResourceLoader.load_threaded_get_status(scene, a) ==3:
		_on_scene_loaded(scene)
		set_process(false)
	进度条.value=进度条.max_value * a[0]
	pass
func sceneSlect():
	match GameData.cWorld:
		"游戏中":
			return "res://Files/StageMap/游戏地图.tscn"
		
